<?php

class Application_Form_UserAdd extends Zend_Form
{

	public function init()
	{
		$this->setMethod('post');
		$this->setAction('add');

		$userid = new Zend_Form_Element_Hidden('id');

		$surname = new Zend_Form_Element_Text('surname');
		$surname->setLabel('Surname');
		$surname->addFilter('StripTags');
		$surname->setRequired(true);

		$name = new Zend_Form_Element_Text('name');
		$name->setLabel('Name');
		$name->addFilter('StripTags');
		$name->setRequired(true);

		$email = new Zend_Form_Element_Text('email');
		$email->setLabel('E-Mail');
		$email->addFilter('StripTags');
		$email->addValidator('EmailAddress');
		$email->setRequired(true);

		$username = new Zend_Form_Element_Text('username');
		$username->setLabel('Username');
		$username->addFilter('StripTags');
		$username->setRequired(true);

		$password = new Zend_Form_Element_Password('password');
		$password->setLabel('Password');
		$password->addFilter('StripTags');

		$userrole = new Zend_Form_Element_Select('userrole');
		$userrole->setMultiOptions(array('admin' => 'Administrator', 'superuser' => 'Superuser', 'insidesales' => 'Inside Sales', 'kam' => 'Key Account Manager', 'pricingmanager' => 'Pricing Manager', 'accountant' => 'Accountant', 'brandmanager' => 'Brand Manager'));
		$userrole->setLabel('Userrole');
		$username->setRequired(true);

		$submit = new Zend_Form_Element_Submit('add');
		$submit->setLabel('Add user');

		$this->addElements(array($userid, $surname, $name, $email, $username, $password, $userrole, $submit));
	}


}

